import React from 'react';
import './index.scss';
import classNames from 'classnames';

const Button = (props) => {
    let { type, children, text, disabled, fixed,  ...another } = props;
    type = (type || '').split(' ');

    let classname = classNames(
        'button',
        type.map(item => ('button-' + item)),
        disabled ? 'button-disabled' : '',
        fixed ? 'button-fixed' : ''
    );
    
    return (
        <button className={classname} {...another}>
            <span>{text || children}</span>
        </button>
    );
}

export default Button;
